<!--课程考核实施计划审核-->
<template>
  <div class="paperprint-container" style="width:100%">
    <div class="search-container" style="margin-top: 0px;">
      <div class="search-container-left">
        <div class="search-container-item">
          <span>学期：</span>
          <el-select
            v-model="termid"
            clearable
            style="width: 120px"
            size="mini"
            placeholder="请选择"
          >
            <el-option
              v-for="item in xqList"
              :key="item.value"
              :label="item.xqmc"
              :value="item.xqmc"
            >
            </el-option>
          </el-select>
        </div>
        <div class="search-container-item">
          <span>培养层次：</span>
          <el-select
            v-model="traininglevel"
            clearable
            style="width: 120px"
            size="mini"
            placeholder="请选择"
          >
            <el-option
              v-for="item in pyccList"
              :key="item.value"
              :label="item.dictValue"
              :value="item.dictValue"
            >
            </el-option>
          </el-select>
        </div>
        <div class="search-container-item">
          <span>修习类型：</span>
          <el-select
            v-model="studytype"
            clearable
            style="width: 120px"
            size="mini"
            placeholder="请选择"
          >
            <el-option
              v-for="item in xxlxList"
              :key="item.value"
              :label="item.label"
              :value="item.value"
            >
            </el-option>
          </el-select>
        </div>
        <div class="search-container-item">
          <span>课程名称：</span>
          <el-input
            style="width: 120px"
            size="mini"
            clearable
            placeholder="请输入课程名称"
            v-model="coursename"
          ></el-input>
        </div>
        <div class="search-container-item">
          <span>状态：</span>
          <el-select
            v-model="sqwr"
            clearable
            style="width: 120px"
            size="mini"
            placeholder="请选择"
          >
            <el-option
              v-for="item in sqwrList"
              :key="item.dictKey"
              :label="item.dictValue"
              :value="item.dictKey"
            >
            </el-option>
          </el-select>
        </div>
        <!-- <div @click="hpsetchock()" style="margin-left:25px">
          <div class="search-button"
            >查询</div
          >
        </div> -->
        <div class="search-button" @click="hpsetchock" style="margin:2px 0 0 5px">
          <img src="../../../assets/assessment/icon-search.png" alt=""/>
          <span>查询</span>
        </div>
        <div>
          <div style="width: 140px;
            margin:2px 0 0 15px;
            height: 28px;
            line-height: 28px;
            background: #f1f8fe;
            border: 1px solid #02c86c;
            border-radius: 6px;
            cursor: pointer;
            display: flex;
            flex-direction: row;
            align-items: center;
            justify-content: center;" @click="dewPriont">
            <img src="../../../assets/assessment/icon-print.png" alt="" style="width: 15px;height: 15px;margin: 0 5px 0 0;" />
            <span style="color:#02c86c;font-size:16px">导出实施计划</span>
          </div>
        </div>
        <div
          style="width:270px;
            margin:2px 0 0 15px;"
          class="add-button"
          @click="toChangeRecord('/teacher/assessment/changeRecord')"
        >
          <img src="../../../assets/assessment/icon-add.png" alt="" style="width:15px;height:15px"/>
          <span>课程考核实施计划变更申请记录</span>
        </div>
      </div>
      <div class="search-container-right">
      </div>
    </div>

    <div class="plan-entry-table-container">
      <el-table
        ref="coursePlanTable"
        :data="tableData"
        style="width: 100%"
        class="xpaas-table-class"
        row-class-name="xpaas-row-class"
        cell-class-name="xpaas-cell-class"
        header-row-class-name="xpaas-header-row-class"
        header-cell-class-name="xpaas-header-cell-class"
        @selection-change="handleSelectionChange"
      >
        <el-table-column width="70" align="center" type="selection" />
        <el-table-column width="200" label="操作" align="center">
          <template slot-scope="scope">
            <div v-show="scope.row.detalestatus" :style="scope.row.detalestatus != '3' ? 'color:#fa5339' : 'color:#51aef6'">{{scope.row.detalestatus === '0' ? '待教员提交' : scope.row.detalestatus === '1' ? '待教研室主任审核': scope.row.detalestatus === '2' ? '待考评中心审核' : '已通过'}}
            </div>
            <!-- <div v-show="scope.row.state" :style="scope.row.state != '2' ? 'color:#fa5339' : 'color:#51aef6'">{{scope.row.state === '0' ? '未提交' : scope.row.state === '1' ? '待审核': scope.row.state === '2' ? '已通过' : '未通过'}}
            </div> -->
            <div style="margin:0 0 10px 0;">
              <div style="width: 80px;
                height: 28px;
                margin:8px auto;
                line-height: 28px;
                background: #f1f8fe;
                border: 1px solid #02c86c;
                border-radius: 6px;
                cursor: pointer;
                display: flex;
                flex-direction: row;
                align-items: center;
                justify-content: center;" @click="RouterTo(scope.row)" v-show="scope.row.detalestatus == '0'">
                <!-- <img src="../../../assets/assessment/icon-plan-record-detail.png" alt="" style="width: 14px;height: 14px;margin: 0 5px 0 0;" /> -->
                <span style="color:#02c86c;font-size:14px">查看/修改</span>
              </div>
              <div style="width: 80px;
                margin:8px auto;
                height: 28px;
                line-height: 28px;
                background: #fef1e8;
                border: 1px solid #f86900;
                border-radius: 6px;
                cursor: pointer;
                display: flex;
                flex-direction: row;
                align-items: center;
                justify-content: center;" @click="rpj(scope.row)">
                <!-- <img src="../../../assets/home/icon-function-query-results.png" alt="" style="width: 14px;height: 14px;margin: 0 5px 0 0;" /> -->
                <span style="color:#f86900;font-size:14px">审批进度</span>
              </div>
              <div class="cz-save" style="width: 80px;
                margin:8px auto;
                height: 28px;
                line-height: 28px;
                background: #efebff;
                border: 1px solid #5230e9;
                border-radius: 6px;
                cursor: pointer;
                display: flex;
                flex-direction: row;
                align-items: center;
                justify-content: center;color:#5230e9" @click="updateSubmitCouPlan(scope.row.planid)" v-if="scope.row.detalestatus === '0'">提　　交</div>
              <div class="cz-change" style="width: 80px;
                margin:8px auto;
                height: 28px;
                line-height: 28px;
                background: #fff6ef;
                border: 1px solid #f3b815;
                border-radius: 6px;
                cursor: pointer;
                display: flex;
                flex-direction: row;
                align-items: center;
                justify-content: center;color:#f3b815" @click="RouterToS(scope.row)" v-show="scope.row.detalestatus === '3'">申请变更</div>
              <!-- <div style="width: 80px;
                margin:8px auto;
                height: 28px;
                line-height: 28px;
                background: #ffefef;
                border: 1px solid #fa5339;
                border-radius: 6px;
                cursor: pointer;
                display: flex;
                flex-direction: row;
                align-items: center;
                justify-content: center;" @click="textid(scope.row.planid, scope.row.detalestatus)" v-show="scope.row.state != '2'">
                <span style="color:#fa5339;font-size:14px">打　　回</span>
              </div> -->
              <!-- <img src="../../../assets/assessment/icon-close.png" alt="" style="width: 14px;height: 14px;margin: 0 5px 0 0;" /> -->
              <!-- <el-button
                plain
                size="mini"
                icon="el-icon-s-unfold"
                type="info"
                @click="RouterTos(scope.row)"
              >
                查  看
              </el-button> -->
              <!-- <el-button
                plain
                size="mini"
                icon="el-icon-edit"
                type="primary"
                @click="RouterTo(scope.row)"
              >
                修 改
              </el-button> -->
              <!-- <el-button
                plain
                size="mini"
                icon="el-icon-circle-close"
                type="danger"
                @click="textid(scope.row.planid, scope.row.detalestatus)"
              >
                打 回
              </el-button> -->
            </div><div>
              <!-- <el-button
                plain
                size="mini"
                icon="el-icon-check"
                type="primary"
                @click="shtg(scope.row.planid, scope.row.detalestatus)"
              >
                审核通过
              </el-button> -->
              <!-- <el-button
                plain
                size="mini"
                icon="el-icon-more-outline"
                type="danger"
                @click="rpj(scope.row.planid)"
              >
                审批进度
              </el-button> -->
            </div>
          </template>
        </el-table-column>
        <el-table-column prop="x" width="130" align="center">
          <template slot-scope="scope" slot="header">
            <div>系</div>
            <div>【教研室】</div>
          </template>
          <template slot-scope="scope">
            <div>{{ scope.row.department }}</div>
            <div>{{ scope.row.teachingandresearchsection }}</div>
          </template>
        </el-table-column>
        <el-table-column prop="kcbh" width="150" align="center">
          <template slot-scope="scope" slot="header">
            <div>课程编号</div>
            <div>【课程名称】</div>
          </template>
          <template slot-scope="scope">
            <div>{{ scope.row.coursenumber }}</div>
            <div>{{ scope.row.coursename }}</div>
          </template>
        </el-table-column>
        <el-table-column
          prop="traininglevel"
          label="培养层次"
          width="100"
          align="center"
        >
        </el-table-column>
        <el-table-column
          prop="studytype"
          label="修习类型"
          width="100"
          align="center"
        >
        </el-table-column>
        <el-table-column
          prop="teachingfaculty"
          label="授课教员"
          width="100"
          align="center"
        >
        </el-table-column>
        <el-table-column prop="grade" label="年级" width="63" align="center">
        </el-table-column>
        <el-table-column
          prop="classes"
          label="教学班"
          width="100"
          align="center"
        >
        </el-table-column>
        <el-table-column
          prop="professionaldivisions"
          label="专业班次"
          width="140"
          align="center"
        >
        </el-table-column>
        <el-table-column prop="classsize" width="90" align="center">
          <template slot-scope="scope" slot="header">
            <div>教学班</div>
            <div>人数</div>
          </template>
        </el-table-column>
        <el-table-column
          prop="totalnumber"
          label="总人数"
          width="90"
          align="center"
        >
        </el-table-column>
        <el-table-column
          prop="scoretypecode"
          label="分制"
          width="90"
          align="center"
        >
        </el-table-column>
        <el-table-column
          prop="finalexamination"
          label="考试方式"
          width="90"
          align="center"
        >
        </el-table-column>
        <el-table-column
          prop="classhour"
          label="结课时间"
          width="90"
          align="center"
        >
        </el-table-column>
        <el-table-column prop="usualscorerate" width="109" align="center">
          <template slot-scope="scope" slot="header">
            <div>课下作</div>
            <div>业比例</div>
          </template>
          <template slot-scope="scope">
            {{scope.row.usualscorerate}}%
          </template>
        </el-table-column>
        <el-table-column prop="examscorerate" width="120" align="center">
          <template slot-scope="scope" slot="header">
            <div>课堂测评</div>
            <div>所占比例</div>
          </template>
          <template slot-scope="scope">
            {{scope.row.examscorerate}}%
          </template>
        </el-table-column>
        <el-table-column prop="midtermscorerate" width="120" align="center">
          <template slot-scope="scope" slot="header">
            <div>期中考试</div>
            <div>所占比例</div>
          </template>
          <template slot-scope="scope">
            {{scope.row.midtermscorerate}}%
          </template>
        </el-table-column>
        <el-table-column prop="experimentscorerate" width="120" align="center">
          <template slot-scope="scope" slot="header">
            <div>课终考核</div>
            <div>所占比例</div>
          </template>
          <template slot-scope="scope">
            {{scope.row.experimentscorerate}}%
          </template>
        </el-table-column>
        <el-table-column prop="oneticketveto" width="120" align="center">
          <template slot-scope="scope" slot="header">
            <div>一票</div>
            <div>否决</div>
          </template>
        </el-table-column>
      </el-table>
    </div>
    <div class="bottom-block">
      <div class="export-button" style="cursor: pointer;">
        <img src="../../../assets/assessment/icon-export.png" alt=""/>
        <div>
          <download-excel
            class="export-btn"
            :data="selectedTableData"
            :fields="jsonFields"
            type="xls"
            name="课程考核实施计划审核.xls"
            style="color: #f3b815"
          >
            &ensp;导出Excel
          </download-excel>
        </div>
      </div>
      <div class="text" style="margin-top: 5px;">
        授课教员名字后加“*”为课程负责人
      </div>
      <div class="pagination-block">
        <el-pagination
          @size-change="handleSizeChange"
          @current-change="handleCurrentChange"
          :current-page="currentPage4"
          :page-sizes="[10, 20, 30]"
          :page-size="100"
          layout="total, sizes, prev, pager, next, jumper"
          :total="total"
        >
        </el-pagination>
      </div>
    </div>

    <el-dialog
      title="审批进度"
      :visible.sync="showAddMessageRemark"
      width="983px"
    >
      <span slot="footer" class="dialog-footer">
        <div class="spjd">
          <div class="time-line-horizon">
            <div
              class="time-line-block"
              style="width: 205px;"
              v-for="(item, index) in pjChecks"
              :key="index"
            >
              <div class="person-name" style="width: 80%">{{ item.job }}</div>
              <div class="line-content">
                <img
                  src="../../../assets/assessment/icon-finish.png"
                  alt="已审批"
                  v-if="+item.state === 1"
                />
                <img
                  src="../../../assets/assessment/icon-dai.png"
                  alt="待审批"
                  v-if="+item.state === 0"
                />
                <img
                  src="../../../assets/assessment/icon-close.png"
                  alt="未审批"
                  v-if="+item.state === -1"
                />
                <div class="date-time">
                  <span class="date" style="margin:-19px 8px">{{ item.checkdate }}</span>
                  <span class="time">{{ item.time }}</span>
                </div>
              </div>
              <!--                 1 待   0 已  2 未-->
             
              <div class="operate">
                <div class="bubble-block" v-show="item.text != ''"  style="left:-30px;width: 100%;background-size: 100% 100%">
                  <span
                    @click="buttonClick('查看', item)"
                    style=" white-space:nowrap;overflow:hidden;text-overflow:ellipsis;  display: block"
                    >{{ item.text }}</span
                  >
                  <div class="operate-button">
                    <div
                      class="button-ck"
                      @click="buttonClick('查看', item)"
                       v-show="item.text != ''"
                    >
                      查看
                    </div>
                    <div
                      class="button-bj"
                      @click="buttonClick('编辑', item)"
                       v-show="item.text != '' && index == 0"
                     
                    >
                      编辑
                    </div>
                    <div
                      @click="buttonClick('删除', item)"
                      class="button-sc"
                      v-show="item.text != '' && index == 0"
                    >
                      删除
                    </div>
                  </div>
                </div>
              </div>
              <div class="operate" @click="buttonClick('留言', item, index)" style="position:relative;left: -70px;top: 0px;width:30px">
                <div
                  class="ly-block"
                  v-if="item.job =='教员'"
                >
                  <img src="../../../assets/assessment/icon-ly.png" alt="" />
                  <div class="ly">留言</div>
                </div>
              </div>
            </div>
          </div>
        </div>
        <button class="green" style="margin-top: 100px;" @click="showAddMessageRemark = false">
          确 定
        </button>
      </span>
    </el-dialog>
     <el-dialog
      title="添加留言"
      :visible.sync="showAddMessageDialog"
      width="983px"
    >
      <div class="message-container">
        <div>添加留言：</div>
        <div>
          <el-input
            v-model="text1.text"
            type="textarea"
            :rows="8"
            style="width: 550px"
          ></el-input>
        </div>
      </div>
      <span slot="footer" class="dialog-footer">
        <!--                      showbjMessageDialog = false-->
        <button class="green" @click="addText">
          确 定
        </button>
      </span>
    </el-dialog>

    <el-dialog
      title="编辑留言"
      :visible.sync="showbjMessageDialog"
      width="983px"
    >
      <div class="message-container">
        <div>编辑留言：</div>
        <div>
          <el-input
            v-model="text1.text"
            type="textarea"
            :rows="8"
            style="width: 550px"
          ></el-input>
        </div>
      </div>
      <span slot="footer" class="dialog-footer">
        <!--                      showbjMessageDialog = false-->
        <button class="green" @click="update">
          确 定
        </button>
      </span>
    </el-dialog>
    <el-dialog
      title="查看留言"
      :visible.sync="showckMessageDialog"
      width="983px"
    >
      <div class="message-container">
        <div>查看留言：</div>
        <div>
          <!--                        v-model="block.bjmeaasgeText"-->
          <el-input
            v-model="text1.text"
            type="textarea"
            :rows="8"
            style="width: 550px"
            disabled="false"
          ></el-input>
        </div>
      </div>
      <span slot="footer" class="dialog-footer">
        <button class="green" @click="showckMessageDialog = false">
          确 定
        </button>
      </span>
    </el-dialog>


     <el-dialog
      title="驳回选择"
      :visible.sync="showBackDialog"
      width="1185px"
      class="manual-entry-container"
    >
      <div class="manual-entry-container">
        <el-row>
          <el-col :span="12">
            <div style=" background: rgba(77, 129, 192, 0.1);">打回至:</div>
          </el-col>
          <el-col :span="12">
            <el-radio-group v-model="reportTypep" >
              <el-radio
                :label="item.label"
                v-for="(item, index) in reportTypepss"
                :key="index"
                class="large"
              >{{ item.value }}
              </el-radio>
            </el-radio-group>
          </el-col>
        </el-row>
        
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button type="primary" @click="ubohuipdateById">确 定</el-button>
         <el-button type="warning" @click="showExportReportDialog = false" style="margin-left:10% ">取消</el-button>
      </span>
    </el-dialog>
    
    <el-dialog
      title="命题计划打回原因"
      :visible.sync="showRMessageDialog"
      width="983px"
      class="back-container"
    >
      <div class="manual-container" style="border: 1px solid #004ca7;
    line-height: 83px;
    font-size: 20px;
    color: #004ca7;
    font-weight: bold;
    vertical-align: top;
    width: 693px;
    margin-left: 100px;">
        <el-row>
          <el-col :span="12">
            <div style=" background: rgba(77, 129, 192, 0.1);">
              <span style="margin-left:30px;">打回至:</span></div>
          </el-col>
          <el-col :span="12">
            <el-radio-group v-model="reportTypep" style="margin-left:100px;">
              <el-radio
                :label="item.label"
                v-for="(item, index) in reportTypepss"
                :key="index"
                class="large"
              >{{ item.value }}
              </el-radio>
            </el-radio-group>
          </el-col>
        </el-row>
        
      </div>
      <div class="back-textas">
        <div>打回原因：</div>
        <div>
          <el-input
            v-model="meaasgeText"
            type="textarea"
            :rows="8"
            style="width: 550px; margin-left: 30px"
          ></el-input>
        </div>
      </div>
      <span slot="footer" class="dialog-footer">
        <button class="green" @click="textDeleteR">确 定</button>
      </span>
    </el-dialog>
     <el-dialog
      title="命题计划打回原因"
      :visible.sync="showAddMessageDialogers"
      width="983px"
      class="back-container"
    >
      <div class="manual-container" style="border: 1px solid #004ca7;
          line-height: 83px;
          font-size: 20px;
          color: #004ca7;
          font-weight: bold;
          vertical-align: top;
          width: 693px;
          margin-left: 100px;">
        <el-row>
          <el-col :span="12">
            <div style=" background: rgba(77, 129, 192, 0.1);">
              <span style="margin-left:30px;">打回至:</span></div>
          </el-col>
          <el-col :span="12">
            <el-radio-group v-model="reportTypep" style="margin-left:100px;">
              <el-radio
                :label="item.label"
                v-for="(item, index) in reportTypepss"
                :key="index"
                class="large"
              >{{ item.value }}
              </el-radio>
            </el-radio-group>
          </el-col>
        </el-row>
        
      </div>
      <div class="back-textas">
        <div>打回原因：</div>
        <div>
          <el-input
            v-model="meaasgeText"
            type="textarea"
            :rows="8"
            style="width: 550px; margin-left: 30px"
          ></el-input>
        </div>
      </div>
      <span slot="footer" class="dialog-footer">
        <button class="green" @click="qxshtgDelete">确 定</button>
      </span>
    </el-dialog>
  </div>
</template>

<script>
import { reqGetXqList } from "../../../api/classHoursAddList/addList";
import {
  reqNjList,
  reqZybcList,
  hpsetchock,
  hpsetchockNew
} from "@/api/admin1/check.js";
import { mapGetters } from "vuex";
import { pyccselect } from "@/api/professional/details";
import { docPrint,hpinPort,dhRemark,addRemark,updateSubmit } from "../../../api/courseExame/courseExa";
import { queryDictByCode,reqCheckYearList } from '@/api/admin1/check'
import { getStore } from '@/util/store.js'
export default {
  data() {
    return {
      roleId:'',
      id: "1",
      textId: "",
      textst:"",
      teald:"",
      current: 1,
      size: 10,
      total: "",
      coursename: "",
      teachingfaculty: "",
      jsonFields: {
        系: "department",
        教研室: "teachingandresearchsection",
        课程编号: "coursenumber",
        课程名称: "coursename",
        培养层次: "traininglevel",
        修习类型: "studytype",
        授课教员: "teachingfaculty",
        年级: "grade",
        教学班: "classes",
        专业班次: "professionaldivisions",
        教学班人数: "classsize",
        总人数: "totalnumber",
        分制: "scoretypecode",
        课下作业比例: "usualscorerate",
        课堂测评所占比例: "examscorerate",
        其中考试所占比例: "midtermscorerate",
        课终考核所占比例: "experimentscorerate ",
        一票否决: "oneticketveto"
      },
      reportTypep: "",
      reportTypepss: [
        {label: "教研室主任", value: "教研室主任"},
      ],
      //审批进度
      showAddMessageRemark: false,
      showBackDialog: false,
      selectedData:[],
      designcontent: "",
      termid: "",
      meaasgeText: " ",
      xqList: [],
      sqwrL: "",
      sqwr: "",
      sqwrList: [],
      traininglevel: "",
      pyccList: [],
      // text1:"",
      text2:"",
      text3:"",
      professionaldivisions: "",
      zybctypelist: [],

      grade: "",
      njList: [],
      selectId: [],
      studytype: "",
      mid:"",
      xxlxList: [
        {
          value: "选修",
          label: "选修"
        },
        {
          value: "必修",
          label: "必修"
        }
      ],
      kcfzr: "",
      kcfzrList: [],
       text1: {
        text: ""
      },
      pjChecks: [],
      removeAst: "",
      removeAllIds: "",
      removeAstate: "",
      tableData: [],

      selectedTableData: [],

      //添加留言
      showAddMessageDialog: false,
      showAddMessageDialogers:false,
      //编辑留言
      showbjMessageDialog: false,
      //查看留言
      showckMessageDialog: false,
      
      removeAll:[],
      delCurrentState:''
    };
  },
  methods: {
    //申请变更
    toChangeRecord(url) {
      this.$router.push(url);
    },
      //修改留言
    update(){
      this.selectop(this.text1.checkid,this.text1.text)
    },
     //修改留言
    selectop(a,b) {
      let obj = {
        cheplanid: a,
        checkremark: b
      };
      return new Promise(() => {
        addRemark(obj).then(res => {
          if (res.status == 200) {
            this.showbjMessageDialog = false;
            this.$message({
              showClose: true,
              message: "修改成功",
              type: "success"
            });
            this.hpinPort();
          }
        });
      });
    },
    //添加留言
    addText() {
      let obj = {
        cheplanid: this.pjChecks[this.text1.index].checkid,
        checkremark: this.text1.text
      };
      return new Promise(() => {
        addRemark(obj).then(res => {
          if (res.status == 200) {
            this.showAddMessageDialog = false;
            this.$message({
              showClose: true,
              message: "添加成功",
              type: "success"
            });
             this.hpinPort();
          }
        });
      });
    },
     //审核流
    buttonClick(type, black, index) {
      if (this.delCurrentState === '0' || type == '查看') {
        this.text1 = {};
        this.text1 = {
          checkid: black.checkid,
          text: black.text,
          index: index
        };
        if (type === "留言") {
          this.text1.text=""
          this.showAddMessageDialog = true;
          console.log(this.text1);
        } else if (type === "查看") {
          console.log("898989")
          this.showckMessageDialog = true;
        } else if (type === "编辑") {
          this.showbjMessageDialog = true;
          console.log(this.text1);
        } else if (type === "删除") {
         this.textdelete(black.checkid);
        }
      } else {
        this.$message("不能操作留言！");
      }
    },
    //删除留言textdelete(block.checkid)
    textdelete(checkid) {
     let obj = {
        cheplanid: checkid,
        checkremark: ""
      };
      return new Promise(() => {
        addRemark(obj).then(res => {
          if (res.status == 200) {
            this.showAddMessageDialog = false;
            this.$message({
              showClose: true,
              message: "删除成功",
              type: "success"
            });
             this.hpinPort();
          }
        });
      });
    },
    rpj(row){
      this.delCurrentState = row.detalestatus;
      this.mid=row.planid;
      this.showAddMessageRemark =true;
      this.hpinPort()
    },
    hpinPort(){
      hpinPort(this.mid).then(res => {
        console.log(this.mid)
         let arrs = res.data.data
         let pjarrs=[]
         for(let i=0; i<arrs.length;i++){
            pjarrs[i] = {
                checkid: arrs[i].cheplanid, //角色对应的id
                text: arrs[i].checkremark, //留言
                job: arrs[i].submitidentifying, //角色名
                state: arrs[i].coucheckstatus,
                checkdate: arrs[i].couchecktime.split("T")[0],
                time: arrs[i].couapplytime.split("T")[0],
                // dengji: arrs[i].roleid
              };
         }
         this.pjChecks = pjarrs
          console.log(this.pjChecks,"111")
        });
    },
    shtg(pl,st) {
      // for(let l=0;l<this.pjChecks.length;l++){
      //         if(this.pjChecks[l].job == "管理员"){
      //             this.pjChecks[l].state=1
      //         }
      //       }
      if(st!=2){
        this.$message.error("未到审核状态或者数据已审核")
      }else{
        let obj= {
          couplanid: pl,
          teald:""
        }
        let newarr = []
        newarr.push(obj)
         dhRemark(newarr).then(res => {
        if (res.data.code == 200) {
            this.$message.success("审核通过成功！");
            this.hpsetchock()
          } else {
            this.$message.error("审核失败！");
          }
          console.log(res.data.data, "111");
        });
      }
    },
    dewPriont() {
      if(this.selectedData.length > 0){
        for (var i = 0; i < this.selectId.length; i++) {
          for (var j = i + 1; j < this.selectId.length; j++) {
            if (this.selectId[i] == this.selectId[j]) {
              //第一个等同于第二个，splice方法删除第二个

              this.selectId.splice(j, 1);

              j--;
            }
          }
        }
        docPrint(this.selectId.toString()).then(respones => {
          // this.$message({
          //   type: "success",
          //   message: "导出成功"
          // });
          // let href =
          //   "http://192.168.1.114:4444/courseimplementplan/coursePlanPrint?ids=" +
          //   this.selectId[t].toString();
          // this.selectId = [];
          // const downloadURL = window.location.origin + `/courseimplementplan/coursePlanPrint?ids=${this.selectId.toString()}`;
          // const downloadURL = `http://192.168.1.114:4446/courseimplementplan/coursePlanPrint?ids=${this.selectId.toString()}`;
          // window.open(downloadURL, '_blank');
          const downloadURL = window.location.origin + `/api/xpaas-course-service/courseimplementplan/coursePlanPrint?ids=${this.selectId.toString()}`;
          window.open(downloadURL, '_blank'); 
        });
        // for (let t = 0; t < this.selectId.length; t++) {
        // }
       } else {
        this.$message.error("请选择需要导出的数据！");
      }
    },
    textid(indx,st) {
      this.meaasgeText="";
      this.reportTypep="";
      this.showAddMessageDialogers = true;
      this.textId = indx;
      this.textst = st;
    },
    textDeleteR() {
      console.log(this.meaasgeText,this.reportTypep,this.textId,"9999")
      // this.meaasgeText="";
      // this.reportTypep="";
      if(this.reportTypep == "教员"){
        this.teald="1"
      }else if(this.reportTypep == "教研室主任"){
        this.teald ="2"
      }
      console.log(this.teald,"1111")
      if(this.textst == 2){
       let obj={
          couplanid: this.textId,
          teaid:this.teald,
          nocheckreason:this.meaasgeText
        }
        console.log(obj,"1111")
        let newarr = []
        newarr.push(obj)
         dhRemark(newarr).then(res => {
        if (res.data.code == 200) {
            this.$message.success("打回成功！");
            this.showAddMessageDialogers=false
            this.hpsetchock()
          } else {
            this.$message.error("打回失败！");
          }
        });
        }else{
          this.$message.error("未到审核状态或者数据已审核，该审核流程暂不能打回！")
        }
      // let obj = {
      //   cheplanid: this.textId,
      //   checkremark: this.meaasgeText
      // };
      // this.showBackDialog = false;
      // checkUpdate(obj).then(res => {
      //   this.$message({
      //     showClose: true,
      //     message: "打回成功",
      //     type: "success"
      //   });
      // });
    },
    //表格列操作提交
    updateSubmitCouPlan(planid){
      updateSubmit(planid, this.roleId).then(res => {
        if(res.data.code == 200){
          this.$message.success("提交成功!")
          this.hpsetchock()
        } else {
          this.$message.error("提交失败!")
          return 
        }
      })
    },
    // 获取学期院历列表
    async getXqList() {
      const result = await reqGetXqList();
      if (result.data.code == 200) {
        this.xqList = result.data.data;
      }
    },
    pyccselect() {
      let code = "pylevel";

      return new Promise(() => {
        pyccselect(code).then(res => {
          this.pyccList = res.data.data[0].children;
          console.log(res.data.data[0].children, "pyccselect");
        });
      });
    },
    loadSqwrList() {
      queryDictByCode("specialStatus").then((res) => {
          console.log("res =>", res);
          this.sqwrList = res.data.data;
      })
    },
    reqNjList() {
      return new Promise(() => {
        reqCheckYearList().then(res => {
          this.njList = res.data.data;
        });
      });
    },
    reqZybcList() {
      return new Promise(() => {
        reqZybcList().then(res => {
          this.zybctypelist = res.data.data;
        });
      });
    },
    hpsetchock() {
      return new Promise(() => {
        // state
        hpsetchockNew(
          this.current,
          this.size,
          this.termid,
          this.designcontent,
          this.traininglevel,
          this.grade,
          this.professionaldivisions,
          this.studytype,
          this.coursename,
          this.teachingfaculty,
          this.sqwr
        ).then(res => {
          this.tableData = res.data.data;
          if (this.tableData != "") {
            this.total = this.tableData[0].tol;
          }
        });
      });
    },
    auditStatus() {
      if(this.selectedData.length > 0){
        this.removeAst = this.removeAstate.split(",");
        this.removeAll = this.removeAllIds.split(",");
        if (
          this.removeAst.indexOf("0") != -1 ||
          this.removeAst.indexOf("1") != -1 ||
          this.removeAst.indexOf("3") != -1
        ) {
          this.$message.error("有未到审批状态的数据或者已经审批过的数据");
        } else {
          let arrs = [];
          for (let i = 0; i < this.removeAll.length; i++) {
            let asr = {
              couplanid: this.removeAll[i],
              teald:""
            };
            arrs.push(asr);
          }
          dhRemark(arrs).then(res => {
            if (res.data.code == 200) {
              this.$message.success("审核通过成功！");
              this.hpsetchock();
            } else {
              this.$message.error("审核失败！");
            }
            console.log(res.data.data, "111");
          });
        }
      } else {
        this.$message.error("请选择需要通过的数据！");
      }
    },
    qxshtgStatus() {
      if(this.selectedData.length > 0){
        this.showAddMessageDialogers = true;
        this.removeAst = this.removeAstate.split(",");
        this.removeAll = this.removeAllIds.split(",");
       } else {
        this.$message.error("请选择需要取消审核通过的数据！");
      }
    },
    qxshtgDelete(){
      console.log(this.removeAst,"阿西吧")
      console.log( this.removeAll,"阿西吧1")
      if(this.reportTypep == "教员"){
        this.teald="1"
      } else if(this.reportTypep == "教研室主任"){
        this.teald ="2"
      }
      if (
        this.removeAst.indexOf("0") != -1 ||
        this.removeAst.indexOf("1") != -1 ||
        this.removeAst.indexOf("3") != -1
      ) {
        this.$message.error("有未到审批状态的数据或者已经审批过的数据");
      }else{
        let arrs = [];
        for (let i = 0; i < this.removeAll.length; i++) {
          let asr = {
            couplanid: this.removeAll[i],
            nocheckreason:this.meaasgeText,
            teaid:this.teald,
          };
          arrs.push(asr);
        }
        dhRemark(arrs).then(res => {
          if (res.data.code == 200) {
            this.$message.success("打回成功！");
            this.showAddMessageDialogers = false
            this.hpsetchock()
          } else {
            this.$message.error("打回失败！");
          }
        });
      }
    },
    //申请变更跳转
    RouterToS(rowIndex) {
      this.$router.push({
        path: "/teacher/assessment/changePlan",
        query: { item: rowIndex }
      });
    },
    //查看/修改跳转
    RouterTo(rowIndex) {
      if(this.roleId === '1490859421955674114'){
        this.$router.push({
          path: "/admin/planManagement/editPlanManages",
          query: { rowIndex: rowIndex }
        });
      } else if(this.roleId === '1490880658945843202' || this.roleId === '1475294432243830786'){
        this.$router.push({
          path: '/teacher/assessment/editPlan',
          query: {
            planid: rowIndex
          }
        })
      }
    },
    handleCurrentChange(val) {
      this.current = val;
    },
    handleSizeChange(val) {
      this.size = val;
    },
    handleSelectionChange(section) {
      this.selectedData = section;
      let selectedList = this.$refs.coursePlanTable.selection;
      if (!Array.isArray(selectedList)) {
        selectedList = [];
      }
      this.selectedTableData = selectedList;

      const arr = [];
      section.forEach(item => {
        arr.push(item.planid);
        this.selectId.push(item.planid);
      });
      this.removeAllIds = arr.join(",");
      const brr = [];
      section.forEach(item => {
        brr.push(item.detalestatus);
      });
      this.removeAstate = brr.join(",");
    }
  },
  created() {
    console.log(this.userInfo,"11111")
    const userInfo = getStore({
      name: "userInfo",
      debug: true,
    }) || {}
    this.roleId = userInfo.content.role_id;
    console.log(this.roleId)
    this.getXqList();
    this.pyccselect();
    this.reqNjList();
    this.reqZybcList();
    this.hpsetchock();
    this.loadSqwrList();
  },
  computed: {
    ...mapGetters(["userInfo"])
  },
};
</script>

<style lang="less" scoped>
.search-button {
  width: 77px;
  height: 28px;
  line-height: 28px;
  background: #f1f8fe;
  border: 1px solid #51aef6;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;

  > span {
    font-size: 16px;
    font-family: Microsoft YaHei;
    font-weight: 400;
    color: #51aef6;
  }

  > img {
    width: 20px;
    height: 20px;
    margin-right: 4px;
  }
}
  @fontFamily:"Microsoft YaHei";
  .xpaas-table-class {
    border: 1px solid #004ca7;
    margin: 10px 0 0 0;
    border-radius: 9px;
    ::v-deep div.el-table__header-wrapper {
      table.el-table__header {
        thead {
          tr.xpaas-header-row-class {
            padding: 0;
            height: 60px;
            background-color: #edf2f9;
            font-size: 16px;
            font-family: @fontFamily;
            font-weight: bold;
            line-height: 20px;
            color: #004ca7;
            th.xpaas-header-cell-class {
              font-weight: bold;
              border-right: 1px solid #c7d7eb;
              border-left: 0;
              border-bottom: 1px solid #c7d7eb;
              background-color: #edf2f9;
              div.cell {
                font-size: 16px;
                font-weight: bold;
                font-family: @fontFamily;
                color: #004ca7;
              }
            }
          }
        }
      }
    }
    ::v-deep div.el-table__body-wrapper {
      table.el-table__body {
        tbody {
          tr.xpaas-row-class {
            td.xpaas-header-cell-class {
              border-right: 1px solid #c7d7eb;
              border-left: 0;
              border-bottom: 1px solid #c7d7eb;
              background-color: #edf2f9;
              div.cell {
                font-size: 16px;
                font-weight: bold;
                font-family: @fontFamily;
                color: #004ca7;
              }
            }
            td.xpaas-cell-class {
              height: 60px;
              border-right: 1px solid #c7d7eb;
              border-left: 0;
              border-bottom: 1px solid #c7d7eb;
              div.cell {
                font-family: @fontFamily;
                color: #004ca7;
              }
            }
          }
        }
      }
    }
  }
.el-dialog {
  overflow: auto;
  height: 439px;
}
.back-textas {
  margin-top: 33px;

  > div {
    display: inline-block;

    &:nth-child(1) {
      padding-left: 111px;
      font-size: 20px;
      color: rgba(0, 76, 167, 1);
      font-weight: bold;
      vertical-align: top;
    }
  }
}
.item_btn {
  width: 55px;
  height: 28px;
  line-height: 28px;
  background: #f1f8fe;
  border: 1px solid #51aef6;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
}
.manual-container {
  .el-dialog__body {
    height: 390px;

    > div {
      width: 1014px;
      border: 1px solid rgba(0, 76, 167, 0.8);
      border-radius: 6px;
      margin: 0 auto;

      > div {
        border-bottom: 1px solid rgba(0, 76, 167, 0.39);

        &:last-child {
          border-bottom: none;
        }

        > div {
          display: flex;

          > div {
            height: 96px;
            display: flex;
            align-items: center;
            justify-content: center;

            &:nth-child(1) {
              width: 420px;
              text-align: center;
              font-size: 16px;
              font-weight: bold;
              color: #004ca7;
              background: rgba(77, 129, 192, 0.1);
            }

            &:nth-child(2) {
              padding-left: 19px;
            }
          }
        }
      }
    }
  }

  .el-dialog__footer {
    padding-bottom: 43px;
  }


}
.assessment-container {
  .export-report-container {
    .el-dialog__body {
      padding: 64px 0 64px 50px;
      .el-radio {
        margin-right: 79px;
      }
    }
    .el-dialog__footer {
      padding-bottom: 103px;
    }
  }
  .import-report-container {
    .el-dialog__body {
      padding-left: 165px;
      padding-top: 71px;
      padding-bottom: 60px;
      > div {
        > span {
          font-size: 18px;
          font-weight: bold;
          line-height: 20px;
          color: #004ca7;
          vertical-align: middle;
        }
        > input {
          width: 254px;
          height: 25px;
          border: 1px solid #004ca7;
          opacity: 1;
          border-radius: 4px;
          padding-left: 5px;
          margin-right: 8px;
          color: #004ca7;
          vertical-align: middle;
        }
        > div {
          display: inline-block;
          font-size: 18px;
          padding: 1px 10px;
          border-radius: 4px;
          vertical-align: middle;
          cursor: pointer;
          &:nth-child(3) {
            color: rgba(2, 200, 108, 1);
            background: #f1fff8;
            border: 1px solid #02c86c;
            position: relative;
            margin-right: 20px;
            > input {
              width: 0px;
              position: absolute;
              left: 0;
              opacity: 1;
              cursor: pointer;
            }
          }
          &:nth-child(4) {
            color: rgba(82, 48, 233, 1);
            background: rgba(235, 230, 255, 1);
            border: 1px solid rgba(82, 48, 233, 1);
          }
        }
      }
    }
    .el-dialog__footer {
      padding-bottom: 76px;
      .green {
        padding: 1px 17px;
      }
    }
  }
}
.plan-entry-table-container {
  margin-top: 15px;
  .el-table td,
  .el-table th.is-leaf,
  .el-table--border,
  .el-table--group {
    border-color: #c7d7eb;
  }
  .el-table__header tr,
  .el-table__header th {
    padding: 0;
    height: 76px;
    background-color: #edf2f9;
    font-size: 16px;
    font-family: Microsoft YaHei;
    font-weight: bold;
    line-height: 20px;
    color: #004ca7;
  }
  .el-table__body tr,
  .el-table__body td {
    padding: 0;
    height: 86px;
  }
  .el-checkbox__inner:hover {
    border-color: #004ca7;
  }
  .el-checkbox__inner {
    border: 1px solid #004ca7;
    border-radius: 0;
  }
  .el-checkbox__input.is-checked .el-checkbox__inner,
  .el-checkbox__input.is-indeterminate .el-checkbox__inner {
    background-color: #004ca7;
    border-color: #004ca7;
  }
  .el-checkbox__input.is-checked + .el-checkbox__label {
    color: #004ca7;
  }
  .el-checkbox.is-bordered.is-checked {
    border-color: #004ca7;
  }
  .el-checkbox__input.is-focus .el-checkbox__inner {
    border-color: #004ca7;
  }
  .export-button {
    background: #fff6ef;
    border: 1px solid #f3b815;
    width: auto;
    height: 28px;
    line-height: 28px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    padding: 3px 10px;
    box-sizing: border-box;
    > span {
      font-size: 16px;
      font-family: Microsoft YaHei;
      font-weight: 400;
      color: #f3b815;
    }
    > img {
      width: 16px;
      height: 16px;
      margin-right: 5px;
    }
  }

  .lucj-import-button {
    .export-button;
    width: 116px;
    margin: 0 auto 12px;
    background: #f1fff8;
    border: 1px solid #02c86c;
    &:last-child {
      margin-bottom: 0px;
    }
    > span {
      color: #02c86c;
    }
  }
  .lucj-expot-button {
    .export-button;
    background: #fff6ef;
    border: 1px solid #f3b815;
    width: 81px;
    margin: 0 auto 12px;
    &:last-child {
      margin-bottom: 0px;
    }
    > span {
      color: #f3b815;
    }
  }
}
.pagination-block {
  margin-top: 15px;
  display: flex;
  flex-direction: row;
  justify-content: center;
}

.paperprint-container {
  .el-checkbox__inner:hover {
    border-color: #004ca7;
  }

  .el-checkbox__inner {
    border: 1px solid #004ca7;
    border-radius: 0;
  }

  .el-checkbox__input.is-checked .el-checkbox__inner,
  .el-checkbox__input.is-indeterminate .el-checkbox__inner {
    background-color: #004ca7;
    border-color: #004ca7;
  }

  .el-checkbox__input.is-checked + .el-checkbox__label {
    color: #004ca7;
  }

  .el-checkbox.is-bordered.is-checked {
    border-color: #004ca7;
  }

  .el-checkbox__input.is-focus .el-checkbox__inner {
    border-color: #004ca7;
  }

  .export-report-container {
    .el-dialog__body {
      padding: 64px 0 64px 50px;

      .el-radio {
        margin-right: 79px;
      }
    }

    .el-dialog__footer {
      padding-bottom: 103px;
    }
  }

  .import-report-container {
    .el-dialog__body {
      padding-left: 165px;
      padding-top: 71px;
      padding-bottom: 60px;

      > div {
        > span {
          font-size: 18px;
          font-weight: bold;
          line-height: 20px;
          color: #004ca7;
          vertical-align: middle;
        }

        > input {
          width: 254px;
          height: 25px;
          border: 1px solid #004ca7;
          opacity: 1;
          border-radius: 4px;
          padding-left: 5px;
          margin-right: 8px;
          color: #004ca7;
          vertical-align: middle;
        }

        > div {
          display: inline-block;
          font-size: 18px;
          padding: 1px 10px;
          border-radius: 4px;
          vertical-align: middle;
          cursor: pointer;

          &:nth-child(3) {
            color: rgba(2, 200, 108, 1);
            background: #f1fff8;
            border: 1px solid #02c86c;
            position: relative;
            margin-right: 20px;

            > input {
              width: 0px;
              position: absolute;
              left: 0;
              opacity: 1;
              cursor: pointer;
            }
          }

          &:nth-child(4) {
            color: rgba(82, 48, 233, 1);
            background: rgba(235, 230, 255, 1);
            border: 1px solid rgba(82, 48, 233, 1);
          }
        }
      }
    }

    /deep/.el-dialog__footer {
      padding-bottom: 76px;

      .green {
        margin-top: 100px;
        padding: 1px 17px;
      }
    }
  }
}
</style>
<style lang="less" scoped>
@import "../../../styles/paper-prints.less";
.paperprint-container {
  .spjd {
    .time-line-horizon::before {width: 420px;}
  }
}
/deep/.el-dialog {
    overflow: auto;
    height: 500px !important;
}
.plan-entry-table-container {
  margin-top: 15px;
  .table-data {
    width: 100%;
    border: 0.8px solid #004ca7;
    border-radius: 9px;
    font-size: 14px;
    font-family: Microsoft YaHei;
    font-weight: 400;
    color: #004ca7;
  }
}
.message-container {
  > div {
    display: inline-block;

    &:nth-child(1) {
      padding-left: 111px;
      font-size: 20px;
      color: rgba(0, 76, 167, 1);
      font-weight: bold;
      vertical-align: top;
    }

    &:nth-child(2) {
    }
  }
}
</style>
